package com.project.service;

import com.project.bean.UserBean;
import com.project.dao.IUserDao;
import com.project.dao.impl.IUserDaoImpl;
import com.project.server.Request;
import com.project.server.Response;

/**
 * 修改
 */

public class FindByIdService implements Servlet{
    private IUserDao dao = new IUserDaoImpl();
  public void service(Request req, Response resp){

      int id = Integer.parseInt(req.getParamMap("id"));

      UserBean user = dao.findById(id);

      String str = "<form action='update'>";
      str+="<input type='hidden' name='id' value='"+id+"'>";
      str+="用户名:"+user.getName()+"<br>";
      str+="密码<input type='text' value='"+user.getPassword()+"' name='pwd'><br>";
      str+="生日:"+user.getDate()+"<br>";
      str+="<input type='submit' value='修改'>";
      str+="</form>";

      resp.sendMessage(str);

  }
}
